import { Injectable } from '@nestjs/common'
import { ConfigService } from '@nestjs/config'
import {
  MulterModuleOptions,
  MulterOptionsFactory
} from '@nestjs/platform-express'

@Injectable()
export class MulterOptionsService implements MulterOptionsFactory {
  constructor(private configService: ConfigService) {}

  createMulterOptions(): MulterModuleOptions {
    return this.configService.get('multer')
  }
}
